﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ZhiAo.CoreLibrary
{
    public class OracleUtility : IDBUtility
    {

        public string SQLQ(DateTime key)
        {
            return "TO_DATE('" + key.ToString("yyyy-MM-dd HH:mm:ss") + "','YYYY-MM-DD HH24:MI:SS')";
        }

        public string SqlQToChar(string key)
        {
            return " TO_CHAR(" + key + ",'YYYY-MM-DD HH24:MI:SS')";
        }


        public string SqlQToChar(string key, string format)
        {
            if (format == "")
                return SqlQToChar(key);
            return "TO_CHAR(" + key + ",'" + format + "')";
        }


        public string SqlPlusMark()
        {
            return "||";
        }

    }
}
